using DevelopmentKit.Domain;
using FluentNHibernate.Automapping;
using FluentNHibernate.Automapping.Alterations;

namespace DevelopmentKit.Infrastructure.NHibernateMaps
{
    public class UserMap : IAutoMappingOverride<User>
    {
        /// <summary>
        /// Alter the automapping for this type
        /// </summary>
        /// <param name="mapping">Automapping</param>
        public void Override(AutoMapping<User> mapping)
        {
            mapping.HasManyToMany(x => x.Roles).Cascade.SaveUpdate();
        }
    }
     
}